﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataModel;

namespace ExtensionMethods
{
    public static class MyExtensions
    {
        public static bool IsDateInEventList(this List<FriendsEvent> friendEventList,
                                             DateTime selectedDate)
        {
            return friendEventList.Count(f => f.EventDate == selectedDate) > 0 ? true : false;
        }

        public static List<FriendsEvent> RemoveEventById(this List<FriendsEvent> friendEventList,
                                                         decimal eventId)
        {
            return friendEventList.Where(f => f.Id != eventId).ToList();
        }
    }
}